CREATE
OR REPLACE PROCEDURE tbxmsp_insert_tbch(p_phid IN NUMBER) 
AS 
BEGIN
    INSERT INTO
    crm3_tend_chk_m (
        phid,
        bill_no,
        bill_dt,
        bill_name,
        project_address,
        phid_pc,
        phid_signtype,
        signup_address,
        phid_tendtype,
        phid_turntype,
        start_dt,
        end_dt,
        phid_chkway,
        senchk_dt,
        senchk_address,
        phid_chkresult,
        linkman,
        mobile,
        tend_dt,
        remarks,
        asr_flag,
        wf_flag,
        arc_flag,
        phid_app,
        app_dt,
        app_status,
        phid_org,
        level_code,
        print_count,
        bill_type,
        user_type,
        py,
        phid_schemeid,
        imp_info,
        ng_insert_dt,
        ng_update_dt,
        ng_record_ver,
        creator,
        editor,
        cur_orgid,
        phid_sourcemid,
        item_resource,
        ng_phid_cu,
        ng_phid_bp,
        ng_phid_org,
        ng_phid_ui_scheme,
        ng_phid_original,
        ng_orgid_original,
        ng_sv_search_key,
        ng_sd_search_key,
        ng_share_sign,
        isimport,
        list_filter_val,
        query_field1_val,
        query_field2_val,
        uimulti_config_id,
        ng_write_source,
        user_bdmc,
        user_ywlb,
        user_sccyllb,
        user_xmms,
        user_tbdw,
        user_tbfzr,
        user_tzje,
        user_tbr,
        user_tbsj,
        user_xmmc,
        user_scfw,
        user_djly
    )
SELECT
    
        seq_auto_phid_tbch_form.nextval,
        bill_no,
        SYSDATE,
        null,
        '',
        p_phid,
        0,
        '',
        0,
        0,
        null,
        null,
        0,
        null,
        '',
        0,
        '',
        '',
        user_tbsj,
        '',
        0,
        null,
        null,
        null,
        null,
        0,
        1,
        0,
        0,
        '',
        '',
        null,
        6870000000000035,
        '',
        SYSDATE,
        SYSDATE,
        1,
        creator,
        creator,
        1,
        0,
        '',
        1,
        0,
        1,
        0,
        0,
        0,
        '10',
        '1',
        5,
        0,
        null,
        null,
        null,
        null,
        null,
        user_bdmc,
        user_yelb,
        user_sccyllb,
        user_xmms,
        user_tbdw,
        phid_tenpsn,
        user_tzje,
        phid_tbpsn,
        null,
        project_name,
        null,
        p_phid
    FROM crm3_advance_project
    WHERE phid = p_phid;
    commit;
    EXCEPTION 
    WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('插入失败，错误信息：' || SQLERRM);
    RAISE;
    ROLLBACK;
END tbxmsp_insert_tbch;